package puntaelena.facilitylocation.hillclimbing.solver.constructions;

import puntaelena.facilitylocation.hillclimbing.solver.agents.IntroduceCitiesContext2forAgents;
import puntaelena.facilitylocation.hillclimbing.solver.agents.IntroduceFacilitiesSearchEnemyFacilityContext2forAgents;
import puntaelena.facilitylocation.hillclimbing.solver.agents.IntroduceFacilitiesSearchFriendCityContext2forAgents;
import puntaelena.facilitylocation.hillclimbing.solver.agents.IntroduceClosedFacilitiesMakeCoalitionsContext2forAgents;

import jfuzzyprincepless.algorithm.structure.ElementsAsAgentsNegotiationFor;
import jfuzzyprincepless.algorithm.structure.INegotiationConstruction;

public class HillClimbingConstructionsFront {
	/**
	 * 		FOR city IN set-of-not-optimal-cities:
	 * 			best-facility = FIND_BEST( city )
	 * 			RELINK_CITY( city, facility )
	 *
	 * NOTE: this is crisp and the most trivial part of fuzzy
	 * distributed hill-climbing algorithm
	 */
	public static INegotiationConstruction
		createFORAllCitiesRelinkTheBest()
	{
		return new ElementsAsAgentsNegotiationFor(
			new IntroduceCitiesContext2forAgents()
		);
	}

	/**
	 * 		FOR facility IN set-of-cheap-useful-and-closed-facilities:
	 * 			OPEN_FACILITY( facility )
	 * 			RELINK_ALL( cities-which-have-expensive-connection, facility )
	 */
	public static INegotiationConstruction
		createFORChpUsflClsdFcltOpenRelikn()
	{
		return new ElementsAsAgentsNegotiationFor(
new IntroduceFacilitiesSearchFriendCityContext2forAgents()
		);
	}

	/**
	 * 		FOR facility IN set-of-cheap-useful-and-closed-facilities:
	 * 			OPEN_FACILITY( facility )
	 * 			RELINK_ALL( cities-which-have-expensive-connection, facility )
	 */
	public static INegotiationConstruction
		createFORFacilitySearchesAndClosesEnemies()
	{
		return new ElementsAsAgentsNegotiationFor(
new IntroduceFacilitiesSearchEnemyFacilityContext2forAgents()
		);
	}

	/**
	 * 		FOR facility IN set-of-cheap-useful-and-closed-facilities:
	 * 			OPEN_FACILITY( facility )
	 * 			RELINK_ALL( cities-which-have-expensive-connection, facility )
	 */
	public static INegotiationConstruction
		createWHILEClosedFacilitiesCoalitions()
	{
		return new ElementsAsAgentsNegotiationFor(
new IntroduceClosedFacilitiesMakeCoalitionsContext2forAgents()
		);
	}
}
